<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<script>


    function Animal(name,leg){
        this.name=name;
        this.leg=leg;

    }
    function Person(name,age){
        this.name=name
        this.age=age;

    }
    function Student(grade){
        this.grade=grade;

    }
    var a=new Animal('猫~',4);
    Person.prototype=a;
    var p=new Person('李四',20);
    Student.prototype=p;
    var s=new Student(2);

    console.log(s.name);
</script>
</body>
</html>